﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using com.clinica.business.BE.acttar;
using com.clinica.business.BE.comun;
using LiclUtil;
using LiclActTar;
using LiclActTar.Views;
using System.Text;

namespace wesiGestClinica.acttar.popups
{
    public partial class FormsPopupAgregarServicios : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Expires = 0;
            Response.CacheControl = "no-cache";
            Page.Header.Controls.Add(new LiteralControl(@"<base target=""_self"" />"));
            if (!Page.IsPostBack)
            {
                UCAgregarServicio.FactorDetras = 0.0M;
                UCAgregarServicio.FactorDetras =  decimal.Parse(Request.QueryString["factor"].ToString().Trim());
            }
            UCAgregarServicio.btn_Buscar.Attributes.Add("onClick", "abrirPopupServicios();");
            UCAgregarServicio.btnGrabar.Click += new EventHandler(btnGrabar_Click);
            UCAgregarServicio.btnCerrar.Attributes.Add("onClick", "enviarParam('1');");
        }

        void btnGrabar_Click(object sender, EventArgs e)
        {
            if (UCAgregarServicio.ValidarGrabacion())
            {
                Session["ListaServiciosAdd"] = UCAgregarServicio.ListaServiciosADD;
                ScriptManager.RegisterStartupScript(this, typeof(Page), "Envio", "enviarParam('1');", true);
            }
        }
    }
}
